package com.niiwoo.civet.trade.dao.entity.credit;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;

public class CreditProjectRepayment {
    private Long id;

    private Long projectId;

    private Integer currentPeriods;

    private Integer totalPeriods;

    private Date addDate;

    private String borrowUserId;

    private BigDecimal refundInterest;

    private BigDecimal costAmount;

    /**
     * 还款状态(0=待还款，1=已经正常还款，2=逾期，3=坏账).
     */
    private Byte status;

    private Date refundDate;

    private Date realRefundDate;

    private BigDecimal overdueFine;

    private BigDecimal realRefundInterest;

    private BigDecimal realCostAmount;

    private Integer overdueDay;

    private BigDecimal overdueAmount;

    private Date updateTime;

    private Byte prepaymentFlag;

    private Byte chargeOffStatus;

    private Integer chargeOffManager;

    private Date chargeOffTime;

    private String chargeOffRemark;

    private BigDecimal platformManagerFee;

    private BigDecimal creditGuaranteeFee;

    private BigDecimal dunningServiceFee;

    private BigDecimal repaidPlatformManagerFee;

    private BigDecimal repaidCreditGuaranteeFee;

    private BigDecimal repaidDunningServiceFee;

    private BigDecimal totalOverdueFine;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public Integer getCurrentPeriods() {
        return currentPeriods;
    }

    public void setCurrentPeriods(Integer currentPeriods) {
        this.currentPeriods = currentPeriods;
    }

    public Integer getTotalPeriods() {
        return totalPeriods;
    }

    public void setTotalPeriods(Integer totalPeriods) {
        this.totalPeriods = totalPeriods;
    }

    public Date getAddDate() {
        return addDate;
    }

    public void setAddDate(Date addDate) {
        this.addDate = addDate;
    }

    public String getBorrowUserId() {
        return borrowUserId;
    }

    public void setBorrowUserId(String borrowUserId) {
        this.borrowUserId = borrowUserId;
    }

    public BigDecimal getRefundInterest() {
        return refundInterest;
    }

    public void setRefundInterest(BigDecimal refundInterest) {
        this.refundInterest = refundInterest;
    }

    public BigDecimal getCostAmount() {
        return costAmount;
    }

    public void setCostAmount(BigDecimal costAmount) {
        this.costAmount = costAmount;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public Date getRefundDate() {
        return refundDate;
    }

    public void setRefundDate(Date refundDate) {
        this.refundDate = refundDate;
    }

    public Date getRealRefundDate() {
        return realRefundDate;
    }

    public void setRealRefundDate(Date realRefundDate) {
        this.realRefundDate = realRefundDate;
    }

    public BigDecimal getOverdueFine() {
        return overdueFine;
    }

    public void setOverdueFine(BigDecimal overdueFine) {
        this.overdueFine = overdueFine;
    }

    public BigDecimal getRealRefundInterest() {
        return realRefundInterest;
    }

    public void setRealRefundInterest(BigDecimal realRefundInterest) {
        this.realRefundInterest = realRefundInterest;
    }

    public BigDecimal getRealCostAmount() {
        return realCostAmount;
    }

    public void setRealCostAmount(BigDecimal realCostAmount) {
        this.realCostAmount = realCostAmount;
    }

    public Integer getOverdueDay() {
        return overdueDay;
    }

    public void setOverdueDay(Integer overdueDay) {
        this.overdueDay = overdueDay;
    }

    public BigDecimal getOverdueAmount() {
        return overdueAmount;
    }

    public void setOverdueAmount(BigDecimal overdueAmount) {
        this.overdueAmount = overdueAmount;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Byte getPrepaymentFlag() {
        return prepaymentFlag;
    }

    public void setPrepaymentFlag(Byte prepaymentFlag) {
        this.prepaymentFlag = prepaymentFlag;
    }

    public Byte getChargeOffStatus() {
        return chargeOffStatus;
    }

    public void setChargeOffStatus(Byte chargeOffStatus) {
        this.chargeOffStatus = chargeOffStatus;
    }

    public Integer getChargeOffManager() {
        return chargeOffManager;
    }

    public void setChargeOffManager(Integer chargeOffManager) {
        this.chargeOffManager = chargeOffManager;
    }

    public Date getChargeOffTime() {
        return chargeOffTime;
    }

    public void setChargeOffTime(Date chargeOffTime) {
        this.chargeOffTime = chargeOffTime;
    }

    public String getChargeOffRemark() {
        return chargeOffRemark;
    }

    public void setChargeOffRemark(String chargeOffRemark) {
        this.chargeOffRemark = chargeOffRemark;
    }

    public BigDecimal getPlatformManagerFee() {
        return platformManagerFee;
    }

    public void setPlatformManagerFee(BigDecimal platformManagerFee) {
        this.platformManagerFee = platformManagerFee;
    }

    public BigDecimal getCreditGuaranteeFee() {
        return creditGuaranteeFee;
    }

    public void setCreditGuaranteeFee(BigDecimal creditGuaranteeFee) {
        this.creditGuaranteeFee = creditGuaranteeFee;
    }

    public BigDecimal getDunningServiceFee() {
        return dunningServiceFee;
    }

    public void setDunningServiceFee(BigDecimal dunningServiceFee) {
        this.dunningServiceFee = dunningServiceFee;
    }

    public BigDecimal getRepaidPlatformManagerFee() {
        return repaidPlatformManagerFee;
    }

    public void setRepaidPlatformManagerFee(BigDecimal repaidPlatformManagerFee) {
        this.repaidPlatformManagerFee = repaidPlatformManagerFee;
    }

    public BigDecimal getRepaidCreditGuaranteeFee() {
        return repaidCreditGuaranteeFee;
    }

    public void setRepaidCreditGuaranteeFee(BigDecimal repaidCreditGuaranteeFee) {
        this.repaidCreditGuaranteeFee = repaidCreditGuaranteeFee;
    }

    public BigDecimal getRepaidDunningServiceFee() {
        return repaidDunningServiceFee;
    }

    public void setRepaidDunningServiceFee(BigDecimal repaidDunningServiceFee) {
        this.repaidDunningServiceFee = repaidDunningServiceFee;
    }

    // 获取当前期应还款金额
    @JSONField(serialize = false)
    public BigDecimal getShouldRepaymentAmount() {
        //(还款本金-实际还款本金)+(还款利息-实际还款利息)+(平台管理费-已还平台管理费)+(催收服务费-已还催收服务费)
        return this.costAmount.subtract(this.realCostAmount)
                .add(this.refundInterest).subtract(this.realRefundInterest)
                .add(this.platformManagerFee).subtract(this.repaidPlatformManagerFee)
                .add(this.dunningServiceFee).subtract(this.repaidDunningServiceFee);
    }

    public BigDecimal getTotalOverdueFine() {
        return totalOverdueFine;
    }

    public void setTotalOverdueFine(BigDecimal totalOverdueFine) {
        this.totalOverdueFine = totalOverdueFine;
    }
}